package com.znufe.exam.repository.h5;

import com.znufe.exam.domain.h5.H5ExamPaper;
import com.znufe.exam.domain.other.KeyValue;
import com.znufe.exam.repository.BaseMapper;
import com.znufe.exam.viewmodel.h5.H5ExamPaperPageRequestVM;
import com.znufe.exam.viewmodel.h5.H5ExamPaperPageVM;
import com.znufe.exam.viewmodel.student.dashboard.PaperFilter;
import com.znufe.exam.viewmodel.student.dashboard.PaperInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface H5ExamPaperMapper extends BaseMapper<H5ExamPaper> {

    int deleteByPrimaryKey(Integer id);

    int insert(H5ExamPaper record);

    int insertSelective(H5ExamPaper record);

    H5ExamPaper selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(H5ExamPaper record);

    int updateByPrimaryKey(H5ExamPaper record);

    List<H5ExamPaper> page(H5ExamPaperPageRequestVM requestVM);

    List<H5ExamPaper> taskExamPage(H5ExamPaperPageRequestVM requestVM);

    List<H5ExamPaper> studentPage(H5ExamPaperPageVM requestVM);

    List<PaperInfo> indexPaper(PaperFilter paperFilter);

    Integer selectAllCount();

    List<KeyValue> selectCountByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    int updateTaskPaper(@Param("taskId") Integer taskId,@Param("paperIds") List<Integer> paperIds);

    int clearTaskPaper(@Param("paperIds") List<Integer> paperIds);

    List<H5ExamPaper> getExamPaperListById(List<Integer> ids);

    List<H5ExamPaper> getAllExamPaperListById(List<Integer> ids);
}
